﻿using System;

using zijian666.Converts.Abstractions;
using zijian666.Converts.Core;

namespace zijian666.Converts.Abstractions;

/// <summary>
/// 转换器切面
/// </summary>
internal interface IConvertFilter<T>
{
    /// <summary>
    /// 转换前
    /// </summary>
    ConvertResult<T> OnConverting(IConvertContext context, IConvertor<T> convertor, object? value);

    ///<summary>
    /// 转换后
    /// </summary>
    void OnConverted(IConvertContext context, IConvertor<T> convertor, object? value, ConvertResult<T> result);

    /// <summary>
    /// 异常
    /// </summary>
    void OnException(IConvertContext context, IConvertor<T> convertor, object? value, Exception exception);
}
